package com.netease.musicweekly.android.widget;

import java.lang.ref.WeakReference;

public class ToolbarProvider {

	private static final ToolbarProvider mInstance = new ToolbarProvider();
	private static WeakReference<ToolbarView> mToolbarRef;

	public static ToolbarProvider getInstance() {
		return mInstance;
	}

	public ToolbarView getToolbar() {
		if (mToolbarRef != null) {
			ToolbarView toolbar = (ToolbarView) mToolbarRef.get();
			return toolbar;
		}
		return null;
	}

	@SuppressWarnings({ "unchecked", "rawtypes" })
	public void setToolbar(ToolbarView toolbarView) {
		mToolbarRef = new WeakReference(toolbarView);
	}
	
}
